<div class="modal-header">
    <h3 class="modal-title">
        <b style="color: #286090">{{workflowTodo.workflowDO.title}}</b>自动化工作流
    </h3>
    <div>
        <b ng-show="workflowTodo.workflowDO.wfType == 0" class="pull-left">OPS</b>
        <i uib-popover-html="assigneeUsersInfo" popover-trigger="'mouseenter'" popover-placement="bottom"
           class="icon icon-info" style="color: green;"></i>
    </div>
</div>

<div class="modal-body">
    <form class="form-horizontal" style="padding: 10px;">

        <div class="form-group">
            <table class="table table-hover table-bordered table-striped">
                <thead>
                <tr>
                    <td>权限组</td>
                    <td>说明</td>
                    <td>权限</td>
                    <td class="col-md-2"
                        ng-show="workflowTodo.todoStatus == 0 && workflowTodo.todoPhase == 0 && type == 0">操作
                    </td>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="todoDetail in workflowTodo.todoDetails">
                    <!--用户信息-->
                    <td>{{todoDetail.name}}
                    </td>
                    <td>{{todoDetail.detail.ldapGroupDO.content}}
                    </td>
                    <td>
                        <b style="color: #777" ng-if="!todoDetail.detail.bind">无</b>
                        <b style="color: #449d44" ng-if="todoDetail.detail.bind">有</b>

                        <b style="color: #2e6da4" class="pull-right" ng-if="todoDetail.detail.apply == true">已申请</b>
                    </td>
                    <td ng-show="workflowTodo.todoStatus == 0 && workflowTodo.todoPhase == 0 && type == 0">
                        <button ng-click="setItem(todoDetail)" class="btn btn-xs pull-left"
                                ng-show="!todoDetail.detail.bind && todoDetail.detail.apply == false"
                                style="background-color: #449d44; color: white;"
                                uib-popover-html="'申请'" popover-trigger="'mouseenter'">
                            <span class="glyphicon glyphicon-plus"></span>申请
                        </button>

                        <button ng-click="setItem(todoDetail)" class="btn btn-xs pull-right"
                                ng-show="!todoDetail.detail.bind && todoDetail.detail.apply == true"
                                style="background-color: #d9534f; color: white;"
                                uib-popover-html="'移除'" popover-trigger="'mouseenter'">
                            <span class="glyphicon glyphicon-remove"></span>取消
                        </button>
                    </td>
                </tr>
                </tbody>

                <tfoot>
                </tfoot>
            </table>
        </div>


        <div class="form-group">
            <label class="col-lg-2 control-label">申请说明</label>
            <div class="col-lg-10">
                            <textarea class="form-control" cols="3" placeholder="简短描述（小于100字）"
                                      ng-model="workflowTodo.content"></textarea>
            </div>
        </div>
    </form>

    <div style="width: 100%; height: 1px; border: 0.5px solid #eee;"></div>

    <!--<div class="modal-body">-->
    <form class="form-horizontal" style="margin-top: 35px;">
        <div ng-include="'tpl/modal/workflow/todo_approval_info.html'"></div>
    </form>
    <!--</div>-->
</div>

<div class="modal-footer">
    <div class="form-group">
        <div style="text-align:center;">
            <button class="btn btn-xs" ng-show="workflowTodo.todoStatus == 0 && workflowTodo.todoPhase == 0"
                    style="margin-right: 25px; background-color: green; color: white;"
                    ng-click="saveTodo()">
                <i class="fa fa-spin fa-spinner" ng-show="btnSaveing"></i>
                <i class="glyphicon glyphicon-ok" ng-show="!btnSaveing"></i>保存
            </button>
            <button class="btn btn-xs" ng-show="todoDetail.todoStatus != 0"
                    style="background-color: #ff8700; color: white;"
                    ng-click="closeModal()">关闭
            </button>
        </div>
    </div>


    <div ng-if="alert.type != ''">
        <div uib-alert ng-class="'alert-' + alert.type" close="closeAlert()">{{alert.msg}}</div>
    </div>
</div>